<div class="modal-dialog">
	<div class="modal-content">
		<form role="form" method="post" id="addForm" action="{:U('slider/edit')}">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h4 class="modal-title">编辑幻灯片</h4>
			</div>
			<div class="modal-body">
				<input type="hidden" name="id" value="{$id}" />
				<div class="form-group">
					<label for="name">名称</label>
					<input type="text" class="form-control" name="name" id="name" maxlength="16" value="{$name}">
				</div>
				<div class="form-group">
					<label for="code">调用名</label>
					<input type="text" class="form-control" name="code" id="code" maxlength="16" value="{$code}">
				</div>

			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-danger">确认保存</button>
			</div>
		</form>
		<script src="/Public/assets/js/jquery.form.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$("#addForm").submit(function(e) {
				e.preventDefault();
				var name = $("#name").val();
				var code = $("#code").val();
				if (name.length < 1) {
					return tips('请输入名称', "danger");
				}
				if (code.length < 1) {
					return tips('请输入调用名称', "danger");
				}
				$("#addForm").ajaxSubmit(function(result) {
					result = JSON.parse(result);
					if (result.status == 'success') {
						location.reload();
					} else {
						tips(result.message, 'danger');
					}
				});
				return;
			});
		</script>
	</div>